<script type="text/javascript">
/* $("#checkAll").checkall({itemName : "id"}); */
</script>
<#include "/component/pagination.html" />
<!-- <script type="text/javascript" src="${basePath}/js/tds-threshold.js"></script> -->
<table class="table table-striped table-hover">
	<thead>
		<tr>
			<th width="25%" scope="col"><@spring.message code='threshold.type'/></th>
			<th width="25%" scope="col"><@spring.message code='threshold.val'/></th>
			<th width="25%" scope="col"><@spring.message code='threshold.creator'/></th>
			<th width="25%" scope="col"><@spring.message code='threshold.createTime'/></th>
		</tr>
	</thead>
	<tbody>
		<#list pager.list as item>
		<#if item.type==3>
		<tr  
			<#if ((item_index+1) % 2 == 0) >class="oddrow"</#if> >
		<!-- 	<td class="c"><input name="id" type="checkbox" value="${item.id}" /></td> -->
	        <td>
	        	<a id="editThresholdBtn"  href="javascript:void(0);"
   					onclick="threshold.edit('${item.id}')"><@spring.message code='threshold.INTERVAL'/>
   				</a>
   			</td>
	        <td>${item.val}(ms)</td>
	        <td>${item.username}</td>
	        <td>${item.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
	    </tr>
	    </#if>
		</#list>
		
	</tbody>
<table class="table table-striped table-hover" style="margin-top:20px;">
	<thead>
		<tr>
			<th width="20%" scope="col"><@spring.message code='threshold.type'/></th>
			<th width="20%" scope="col"><@spring.message code='threshold.val'/></th>
			<th width="20%" scope="col"><@spring.message code='threshold.importance'/></th>
			<th width="20%" scope="col"><@spring.message code='threshold.creator'/></th>
			<th width="20%" scope="col"><@spring.message code='threshold.createTime'/></th>
		</tr>
	</thead>
	<tbody>
		<#list pager.list as item>
		<tr>  
		<#switch item.type>
			<#case 0>
				<td>
		        	<a id="editThresholdBtn"  href="javascript:void(0);"
	   					onclick="threshold.edit('${item.id}')"><@spring.message code='threshold.CPU'/>
	   				</a>
	   			</td>
		        <td>${item.val}(%)</td>
			<#break>
			
			<#case 1>
				<td>
		        	<a id="editThresholdBtn"  href="javascript:void(0);"
	   					onclick="threshold.edit('${item.id}')"><@spring.message code='threshold.MEM'/>
	   				</a>
	   			</td>
		        <td>${item.val}(%)</td>
			<#break>
			
			<#case 2>
		        <td>
		        	<a id="editThresholdBtn"  href="javascript:void(0);"
	   					onclick="threshold.edit('${item.id}')"><@spring.message code='threshold.DIR'/>
	   				</a>
	   			</td>
		        <td>${item.val}(%)</td>			
			<#break>
			
			<#case 4>
		        <td>
		        	<a id="editThresholdBtn"  href="javascript:void(0);"
	   					onclick="threshold.edit('${item.id}')"><@spring.message code='threshold.GLOBAL'/>
	   				</a>
	   			</td>
		        <td>${item.val}(%)</td>		
			<#break>
			
			<#case 5>
		        <td>
		        	<a id="editThresholdBtn"  href="javascript:void(0);"
	   					onclick="threshold.edit('${item.id}')"><@spring.message code='threshold.POOL'/>
	   				</a>
	   			</td>
		        <td>${item.val}(%)</td>		
			<#break>
			
			<#case 6>
		        <td>
		        	<a id="editThresholdBtn"  href="javascript:void(0);"
	   					onclick="threshold.edit('${item.id}')"><@spring.message code='threshold.OSD'/>
	   				</a>
	   			</td>
		        <td>${item.val}(ms)</td>			
			<#break>
			
			<#case 7>
		        <td>
		        	<a id="editThresholdBtn"  href="javascript:void(0);"
	   					onclick="threshold.edit('${item.id}')"><@spring.message code='threshold.OSDDUNP'/>
	   				</a>
	   			</td>
		        <td></td>		
			<#break>
			
			<#case 8>
		        <td>
		        	<a id="editThresholdBtn"  href="javascript:void(0);"
	   					onclick="threshold.edit('${item.id}')"><@spring.message code='threshold.OVERALL'/>
	   				</a>
	   			</td>
		        <td></td>			
			<#break>
		
		</#switch>
		<#if item.type !=3 >
	        <td>
	        	<#switch item.importance>
	        		<#case 0>
	        			<@spring.message code='threshold.invalid'/>
					<#break>
						
					<#case 1>
						<@spring.message code='threshold.low'/>
					<#break>
						
					<#case 2>
						<@spring.message code='threshold.middle'/>
					<#break>
						
					<#case 3>
						<@spring.message code='threshold.high'/>
					<#break>
	        	</#switch>
	        </td>
	        <td>${item.username}</td>
	        <td>${item.createTime?string('yyyy-MM-dd HH:mm:ss')}</td>
	     </#if>
	    </tr>
		</#list>
	</tbody>
</table>
<@pagination/>

